--"k
local packer = require("packer")
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
    fn.system({
      'git','clone', '--depth', '1',
      'https://gitee.com/zsdfbb/packer.nvim.git',
      install_path
    })
    vim.cmd 'packadd packer.nvim'
end
-- only required if you have packer configured as 'opt'
vim.cmd [[packadd packer.nvim]]
packer.startup({
  function(use)
    use "zsdfbb/packer.nvim"
    use "guoqishiping/onedark.nvim"
    use "qfusion/tokyonight.nvim"
    use {"dw8603/nvim-tree.lua", require="donghufeng/nvim-web-devicons"}
    use {"qfusion/bufferline.nvim", require={"donghufeng/nvim-web-devicons","William/vim-bbye"}}
    use {"cangmj/lualine.nvim", require="donghufeng/nvim-web-devicons"}
    use "William135/lualine-lsp-progress"
    use {"cangmj/telescope.nvim", require="cangmj/plenary.nvim"}
    use {"cangmj/plenary.nvim"}
    use "William135/telescope-env.nvim"
    use "William135/dashboard-nvim"
    use "William135/project.nvim"
    use {"zsdfbb/nvim-treesitter", run=":TSUpdate"}
    use "qfusion/mason.nvim"
    use "qfusion/mason-lspconfig.nvim"
    use "qfusion/nvim-lspconfig"
    use "zsdfbb/nvim-cmp"
    use "dw8603/vim-vsnip"
    use "dw8603/cmp-vsnip"
    use "qfusion/cmp-nvim-lsp"
    use "dw8603/cmp-buffer"
    use "zsdfbb/cmp-path"
    use "cangmj/cmp-cmdline"
    use "jianshanbushishan/friendly-snippets"
    use "William135/lspkind.nvim"
    use "William135/indent-blankline.nvim"
    use "mirrors_nvimdev/lspsaga.nvim"
    use "William135/formatter.nvim"
    use "nvim-plugin/schemastore.nvim"
    use "yzymickey/vimspector"

  end,
  config = {
    -- 并发限制数
    max_jobs = 16,
    -- 自定义源
    git = {
      -- default_url_format = 'https://hub.fastgit.xyz/%s',
      -- default_url_format = 'https://mirror.ghproxy.com/https://github.com/%s'
      -- default_url_format = 'https://gitcode.net/mirrors/%s',
      -- default_url_format = 'https://gitclone.com/github.com/%s',
      default_url_format = 'https://gitee.com/%s',
    },
    display = {
      open_fn = function()
        return require("packer.util").float({ border = "single" })
      end,
    },
  },
})

pcall(
  vim.cmd,
  [[
    autogroup packer_user_config
    autocmd!
    autocmd BufWritePost plugins.lua source <afile> | PackerSync
    augroup end
  ]]
)


